<%-- 
    Document   : index
    Created on : 22/09/2013, 13:25:40
    Author     : VemQueTem
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Desenvolvimento WEB - UNI-ANHANGUERA</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="arquivos/default.css" rel="stylesheet" type="text/css" />
        <script language="javascript" type="text/javascript">
            function validaCampos() {
                var name = '';
                if (document.getElementById("txtName").value == '') {
                    name = 'Nome';
                    document.getElementById("txtName").focus();
                    alert("Campo: " + name + " não pode ficar vazio");
                    return false;
                } else if (document.getElementById("txtUName").value == '') {
                    name = 'UserName';
                    document.getElementById("txtUName").focus();
                    alert("Campo: " + name + " não pode ficar vazio");
                    return false;
                } else if (document.getElementById("txtPassword").value == '') {
                    name = 'Password';
                    document.getElementById("txtPassword").focus();
                    alert("Campo: " + name + " não pode ficar vazio");
                    return false;
                } else if (document.getElementById("txtREPassword").value == '') {
                    name = 'Re-Password';
                    document.getElementById("txtREPassword").focus();
                    alert("Campo: " + name + " não pode ficar vazio");
                    return false;
                } else if (document.getElementById("txtPassword").value !=
                        document.getElementById("txtREPassword").value) {
                    alert("Senhas Não Conferem\n Digite novamente");
                    document.getElementById("txtPassword").focus();
                    return false;
                }
            }

        </script>
    </head>
    <body>
        <div id="wrapper">
            <div id="header">
                <div id="logo">
                    <h1><a href="#">DW</a></h1>
                    <h2><span>Uni-Anhanguera</span></h2>
                </div>
                <div id="menu">
                    <ul>
                        <li class="active"><a href="main.jsp">Home</a></li>
                        <li><a href="usuarios.jsp">Usuarios</a></li>
                        <li><a href="contatos.jsp">Contatos</a></li>
                        <li><a href="logout">Logout</a></li>
                    </ul>
                </div>
                <!-- end div#menu -->
            </div>
            <!-- end div#header -->
            <div id="page">
                <div id="content">
                    <div id="welcome">
                        <h1>Adicionar Novo Usuário</h1>
                        <form action="addUserServlet" method="post" onsubmit="return validaCampos();">
                            <center>
                                <table>
                                    <tr>
                                        <td>Nome:</td>
                                        <td><input type="text" name="txtName" id="txtName" size="30"></td>
                                    </tr>
                                    <tr>
                                        <td>UserName:</td>
                                        <td><input type="text" name="txtUName" id="txtUName" size="30"></td>
                                    </tr>
                                    <tr>
                                        <td>Password:</td>
                                        <td><input type="password" name="txtPassword" id="txtPassword" size="30"></td>
                                    </tr>
                                    <tr>
                                        <td>Re-Password:</td>
                                        <td><input type="password" name="txtREPassword" id="txtREPassword" size="30"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="right"><input type="submit" value="Cadastrar"></td>
                                    </tr>
                                </table>
                                <hr><hr><br><h2><a href="usuarios.jsp">Voltar</a></h2>
                              </center>
                        </form>
                     </div>
                  </div>
                <div id="sidebar">
                    <ul>
                        <li id="submenu">
                            <h2>Menu</h2>
                            <ul>
                                <li><a href="usuarios.jsp">Usuarios</a></li>
                                <li><a href="#">Contatos</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <div style="clear: both; height: 1px">
                    
                </div>
                
            </div>
            <div id="footer">
                 <p id="legal">Designed by Donizete Júnior</a>.</p>
             </div>
        </div>
    </body>
</html>
